﻿<?xml version="1.0"?>
<ChartConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" format="Png" width="600" height="400" xmlns="http://dev.buwog.at/schemas/ChartBuilder/v1">
  <DataSource name="dm_exec_sessions">
    <ConnectionString>Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=master;Data Source=.\SQLExpress</ConnectionString>
    <SqlCommand>select case when nt_user_name &lt;&gt; '' then nt_user_name else login_name end as login_name,
			cpu_time, total_scheduled_time, total_elapsed_time
			from sys.dm_exec_sessions
			where host_process_id is not null
			order by total_scheduled_time desc</SqlCommand>
  </DataSource>
	<Series>
		<Series name="total_scheduled_time" dataSource="dm_exec_sessions" legendText="Activity">
      <ChartType>Area</ChartType>
      <XAxisTitle>User</XAxisTitle>
      <XValueColumn>login_name</XValueColumn>
      <YAxisTitle>Activity</YAxisTitle>
      <YValueColumn>total_scheduled_time</YValueColumn>
    </Series>
		<Series name="total_elapsed_time" dataSource="dm_exec_sessions" legendText="Lifetime">
      <ChartType>Line</ChartType>
      <XAxisTitle />
      <XValueColumn>login_name</XValueColumn>
      <YAxisTitle>Lifetime</YAxisTitle>
      <YValueColumn>total_elapsed_time</YValueColumn>
    </Series>
		<Series name="cpu_time" dataSource="dm_exec_sessions" legendText="CPU">
      <ChartType>Line</ChartType>
      <XAxisTitle>User</XAxisTitle>
      <XValueColumn>login_name</XValueColumn>
      <YAxisTitle>CPU</YAxisTitle>
      <YValueColumn>cpu_time</YValueColumn>
    </Series>
  </Series>
</ChartConfiguration>